import type { Directive, DirectiveBinding } from 'vue';

import { useAnimateCss } from '@/hooks/index';

export const animate: Directive = {
  mounted(el: HTMLElement, binding: DirectiveBinding) {
    const { value } = binding;
    try {
      useAnimateCss(el, value).then(() => {
        console.log('动画执行完成');
      });
    } catch (error) {
      console.error('动画执行报错：', error);
    }
  },
};
